package com.hqyj.controller;


import com.hqyj.pojo.Reservation;
import com.hqyj.service.ReservationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

/**
 * <p>
 * 实时消费表 前端控制器
 * </p>
 *
 * @author rock
 * @since 2021-10-25
 */
@RestController
@RequestMapping("/reservation")
public class ReservationController {
    @Autowired
    ReservationService reservationService;

    //加载表格数据
    @RequestMapping("/reservationList")
    public HashMap<String,Object> listPage(Reservation reservation){
        return reservationService.select(reservation);
    }
    //修改
    @RequestMapping("/update")
    public HashMap<String,Object>  update(Reservation reservation){
        return reservationService.update(reservation);
    }
    //新增
    @RequestMapping("/add")
    public HashMap<String,Object> add(Reservation reservation){
        return reservationService.add(reservation);
    }
    //删除
    @RequestMapping("/del")
    public HashMap<String,Object> del(Integer id){
        return reservationService.del(id);
    }
}

